//
// Created by shanshi on 17/6/2025.
//

#include <iostream>

typedef double (*pfdef)(int);

double func1(int a);

double func2(int a);

double func3(int a, double (*pf)(int));
// 函数指针数组
double (*pfa[2])(int) = {func1, func2};

// int main() {
//     using namespace std;
//     double (*pf)(int) =  func2;
//     cout << (*pf)(100) << endl;
//     cout <<  func3(100, func1) << endl;
//     cout << (*pfa[1])(100) << endl;
//     pfdef p1 = func1;
//     cout << p1(100) << endl;
// }

double func1(int a) {
    return a * 0.1;
}

double func2(int a) {
    return a * 2.0;
}

double func3(int a, double (*pf)(int)) {
    return (*pf)(a);
}